From 1ae5c2a138546d12d2782b4175c1e4e69296defa Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Tue, 14 Oct 2014 15:30:34 +0200 Subject: [PATCH] window: unset menubar before unsetting focus on dispose() If the menubar has an app-menu popover, and it is shown at the time of disposing the window, it will attempt to transfer focus back to the previous focus widget when undoing modality, even though the dispose() code already did set_focus(NULL) previously. At the time the popover is removed, there aren't many hints as to whether the toplevel or the focus widget are being destroyed (ie. not still under in_destruction), so just swap the order of these two calls. For every other popover, this would all happen within dispose/destroy, which is handled better. --- gtk/gtkwindow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index 424779c7ae..bf6d85c630 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -2938,9 +2938,9 @@ gtk_window_dispose (GObject *object) GtkWindow *window = GTK_WINDOW (object); GtkWindowPrivate *priv = window->priv; + unset_titlebar (window); gtk_window_set_focus (window, NULL); gtk_window_set_default (window, NULL); - unset_titlebar (window); remove_attach_widget (window); G_OBJECT_CLASS (gtk_window_parent_class)->dispose (object); -- 2.30.2